package com.simple.car.loader.server.entity;

import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

import java.util.Date;
import java.util.Objects;

/**
 * 车辆运行时信息
 */
@DatabaseTable(tableName = "t_running_info")
public class RunningInfo {

    /**
     * 主键
     */
    @DatabaseField(generatedId = true)
    private Integer id;

    /**
     * 经度
     */
    @DatabaseField(columnName = "lon")
    private Double lon;

    /**
     * 纬度
     */
    @DatabaseField(columnName = "lat")
    private Double lat;

    /**
     * 高度
     */
    @DatabaseField(columnName = "height")
    private Double height;

    /**
     * 位置描述
     */
    @DatabaseField(columnName = "position")
    private String position;

    /**
     * 状态描述
     */
    @DatabaseField(columnName = "describe")
    private String describe;

    /**
     * 危险等级
     */
    @DatabaseField(columnName = "level")
    private String level;

    /**
     * 车辆速度（它是卫星速度，存在一定误差，只可做参考，不完全可信）
     */
    @DatabaseField(columnName = "speed")
    private Double speed;

    /**
     * 发生时间
     */
    @DatabaseField(columnName = "create_time", dataType = DataType.DATE)
    private Date createTime;

    /**
     * 视频路径
     */
    @DatabaseField(columnName = "file_path")
    private String filePath;

    /**
     * 状态，0：已记录 1：等待中 2：处理中 3：已完成
     */
    private int statue;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Double getLon() {
        return lon;
    }

    public void setLon(Double lon) {
        this.lon = lon;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Double getHeight() {
        return height;
    }

    public void setHeight(Double height) {
        this.height = height;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getDescribe() {
        return describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public String getLevel() {
        return level;
    }

    public void setLevel(String level) {
        this.level = level;
    }

    public Double getSpeed() {
        return speed;
    }

    public void setSpeed(Double speed) {
        this.speed = speed;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    public int getStatue() {
        return statue;
    }

    public void setStatue(int statue) {
        this.statue = statue;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        RunningInfo that = (RunningInfo) o;
        return getStatue() == that.getStatue() && Objects.equals(getId(), that.getId()) && Objects.equals(getLon(), that.getLon()) && Objects.equals(getLat(), that.getLat()) && Objects.equals(getHeight(), that.getHeight()) && Objects.equals(getPosition(), that.getPosition()) && Objects.equals(getDescribe(), that.getDescribe()) && Objects.equals(getLevel(), that.getLevel()) && Objects.equals(getSpeed(), that.getSpeed()) && Objects.equals(getCreateTime(), that.getCreateTime()) && Objects.equals(getFilePath(), that.getFilePath());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getLon(), getLat(), getHeight(), getPosition(), getDescribe(), getLevel(), getSpeed(), getCreateTime(), getFilePath(), getStatue());
    }
}
